using System;
using System.Collections.Generic;
using System.Text;
using System.Resources;

namespace NBusiness.CodeDom.Compiler
{
    [Serializable]
	public class EntityBuildError
	{
        #region Member fields and properties
        private string _errorCode;
        private string _message;
        private EntityElement _element;
        private EntityBuildErrorType _type;

        public string ErrorCode
        {
            get { return _errorCode; }
        }

        public virtual string Message
        {
            get { return _message; }
        }

        public virtual EntityElement Element
        {
            get { return _element; }
        }

        public virtual EntityBuildErrorType Type
        {
            get { return _type; }
        } 
        #endregion

        #region Constructors
        public EntityBuildError(string errorCode, string message, EntityElement element, EntityBuildErrorType type)
        {
            _errorCode = errorCode;
            _message = message;
            _element = element;
            _type = type;
        } 
        #endregion

        #region overrides
        public override string ToString()
        {
            return string.Format("{0}{1} at {2}{1} in {3}",
                Message,
                Environment.NewLine,
                _element,
                _element.Path);
        } 
        #endregion
	}
}
